fix: fall back to hub endpoints on 401 for public bundles#23
Merged
justinmerrell merged 1 commit intomainfrom Apr 3, 2026
Merged
fix: fall back to hub endpoints on 401 for public bundles#23justinmerrell merged 1 commit intomainfrom
justinmerrell merged 1 commit intomainfrom
Conversation
When pulling a public bundle without MUSHER_API_KEY set, the SDK raised AuthenticationError instead of falling back to the hub endpoint. The hub fallback only caught APIError with status 403, but 401 raises AuthenticationError which is not a subclass of APIError. Now both resolve() and _pull_version() catch AuthenticationError (401) and APIError with status 403, falling back to /v1/hub/... endpoints for public bundle access without credentials. Closes #22 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
MUSHER_API_KEY, the SDK raisedAuthenticationErrorinstead of falling back to hub endpoints_pull_versiononly caughtAPIError(403), but 401 raisesAuthenticationErrorwhich is not a subclass ofAPIErrorresolve()and_pull_version()catchAuthenticationError(401) andAPIError(403), falling back to/v1/hub/...endpoints matching the CLI's behaviorCloses #22
Test plan
test_pull_hub_fallback_401— verifies pull falls back to hub on 401test_resolve_hub_fallback_401— verifies resolve falls back to hub on 401test_resolve_hub_fallback_403— verifies resolve falls back to hub on 403musher-examples/demo-starter:1.0.0from hub.musher.dev without API key🤖 Generated with Claude Code